{% include base_path %}

<div class="page__footer-follow">
  <ul class="social-icons">
    {% if site.data.ui-text[site.locale].follow_label %}
    <li><strong>{{ site.data.ui-text[site.locale].follow_label }}</strong></li>
    {% endif %}
    {% if site.twitter.username %}
    <li><a href="https://twitter.com/{{ site.twitter.username }}"><i class="fa fa-fw fa-twitter-square" aria-hidden="true"></i> Twitter</a></li>
    {% endif %}
    {% if site.facebook.username %}
    <li><a href="https://facebook.com/{{ site.facebook.username }}"><i class="fa fa-fw fa-facebook-square" aria-hidden="true"></i> Facebook</a></li>
    {% endif %}
    {% if site.author.github %}
    <li><a href="http://github.com/{{ site.author.github }}"><i class="fa fa-fw fa-github" aria-hidden="true"></i> GitHub</a></li>
    {% endif %}
    {% if site.author.bitbucket %}
    <li><a href="http://bitbucket.org/{{ site.author.bitbucket }}"><i class="fa fa-fw fa-bitbucket" aria-hidden="true"></i> Bitbucket</a></li>
    {% endif %}
    <li><a href="{{ base_path }}/feed.xml"><i class="fa fa-fw fa-rss-square" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].feed_label }}</a></li>
  </ul>
</div>

<div class="page__footer-copyright">&copy; {{ site.time | date: '%Y' }} {{ site.name | default: site.title }}. {{ site.data.ui-text[site.locale].powered_by }} <a href="http://jekyllrb.com"
                                                                                                                                                                  rel="nofollow">Jekyll</a> &amp; <a
  href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.
</div>

<div id="dialog" style="display: none">
  <h2 class="mocklab-popup__title">Looking for super-quick hosted mocks? Try MockLab</h2>
  <p>Instant mock services on your own public URL, zero code required. Paste, record and generate mock data. Tester-friendly UI.</p>
</div>

<script type="text/javascript">
  function setNotificationSeenCookie() {
    var expiresDate = new Date();
    expiresDate.setTime(expiresDate.getTime() + (30 * 86400000));
    document.cookie = "mocklab_notification_seen=true;expires=" + expiresDate.toGMTString() + ";path=/";
  }

  function sendNavigatedToMockLabEvent(location) {
    ga('send', 'event', location, 'navigated_to_mocklab', 'Navigated to MockLab', 1);
  }

  window.onload = function () {
    $("a[title='MockLab']").click(function() {
      ga('send', 'event', 'primary_nav', 'mocklab_clicked', 'MockLab clicked', 1);
      sendNavigatedToMockLabEvent('primary_nav');
    });

    $("a[title='Consulting Services']").click(function() {
      ga('send', 'event', 'primary_nav', 'consulting_services_clicked', 'Consulting Services clicked', 1);
    });

    if (!document.cookie.includes('mocklab_notification_seen') && !window.suppressMockLabPopover) {
      window.setTimeout(function () {
        $("#dialog").dialog({
          dialogClass: 'mocklab-popup',
          draggable: false,
          resizable: false,
          modal: true,
          show: {
            effect: 'fade',
            duration: 1000
          },
          buttons: [{
            class: 'mocklab-popup__confirm-button',
            text: "Learn More",
            click: function () {
              ga('send', 'event', 'mocklab_popup', 'learn_more_clicked', 'Learn More clicked', 1);
              sendNavigatedToMockLabEvent();
              window.location.href = "http://get.mocklab.io/?utm_source=wiremock.org&utm_medium=mocklab-popup&utm_campaign=mocklab"
            }
          }]
        });

        setNotificationSeenCookie();
        ga('send', 'event', 'mocklab_popup', 'mocklab_popup_seen', 'MockLab popup seen', 0);
      }, 500);

    }

    $("#mocklab-callout-learn-more").click(function() {
      ga('send', 'event', 'mocklab_homepage_section', 'learn_more_clicked', 'Learn More clicked', 1);
      sendNavigatedToMockLabEvent('mocklab_homepage_section');
    });

    $("#mocklab-callout-try-it-now").click(function() {
      ga('send', 'event', 'mocklab_homepage_section', 'try_it_now_clicked', 'Try It Now clicked', 2);
      sendNavigatedToMockLabEvent('mocklab_homepage_section');
    });
  };
</script>
